import java.io.*;

import java.util.*;

import java.sql.*;

import javax.servlet.*;

import javax.servlet.http.*;





/**

 * This is a simple example of an HTTP Servlet.  It responds to the GET

 * method of the HTTP protocol.

 */

public class ResponseServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)

    throws ServletException, IOException {

        PrintWriter out = response.getWriter();

       

        // then write the data of the response

        String username = request.getParameter("username");

       

        if ((username != null) && (username.length() > 0)) {

            out.println("<h2>Hello, " + username + "!</h2>");

        }

       

        String hobby = request.getParameter("hobby");

       

        if ((hobby != null) && (hobby.length() > 0)) {

            out.println("<h2>Your hobby is " + hobby + "!</h2>");

        }
        
        String name = request.getParameter("name");

        

        if ((name != null) && (name.length() > 0)) {

            out.println("<h2>Hello, " + name + "!</h2>");

        }
        
        String address = request.getParameter("address");

        

        if ((address != null) && (address.length() > 0)) {

            out.println("<h2>you live in, " + address + "!</h2>");

        }
        
        String number = request.getParameter("number");

        

        if ((number != null) && (number.length() > 0)) {

            out.println("<h2>your number is, " + number + "!</h2>");

        }
        
        String email = request.getParameter("email");

        

        if ((email != null) && (email.length() > 0)) {

            out.println("<h2>your email is, " + email + "!</h2>");

        }

    }

   

    public String getServletInfo() {

        return "The Response servlet says hello.";

    }

}